<template>
	<view>
		<view class="group" style="background-color: white;">
			<view class="header">
				<view class="line"></view>
				<view class="header-title">合作品牌</view>
			</view>
			<view class="top-list">
				<view class="top-list-item" v-for="(item, index) in brandList" :key="index">
					<image class="top-item-image" :src="item.thumb" mode="aspectFill"></image>
					<view class="top-item-mark">
						{{item.name}}
					</view>
				</view>
			</view>
		</view>
		<view class="group">
			<view class="header">
				<view class="line"></view>
				<view class="header-title">楼盘套餐</view>
			</view>
			<view class="list">
				<view class="item" v-for="(item, index) in comboList" :key="index">
					<view>
						<view class="item-image"><image :src="item.thumb" mode="aspectFill"></image></view>
						<view class="item-text-content">
							<view class="item-title">{{ item.name }}</view>
							<view class="horizontal">
								<view class="item-range">{{ item.model }}m²</view>
								<view class="item-price">￥{{ item.price }}</view>
							</view>
							<view class="item-content">{{ item.desc_str }}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			comboList: [],
			brandList: []
		};
	},
	onLoad(e) {
		uni.request({
			url: 'https://baiyi.kent.work/api/v1/system/getComboList',
			method: 'POST',
			data: {
				page: 1,
				limit: 10
			},
			success: res => {
				console.log(res);
				this.comboList = res.data.data.list;
			}
		});
		uni.request({
			url: 'https://baiyi.kent.work/api/v1/system/getBrandList',
			method: 'POST',
			success: res => {
				console.log(res);
				this.brandList = res.data.data;
			}
		});
	},
	methods: {}
};
</script>

<style lang="less" scoped>
::-webkit-scrollbar {
	display: none;
}
.header {
	margin-left: 40rpx;
}
.header-title {
	font-size: 28rpx;
	margin-left: 20rpx;
}
.group {
	display: flex;
	flex-direction: column;
	padding: 28rpx 0;
}
.horizontal {
	display: flex;
	justify-content: space-between;
}
.top-list {
	overflow-x: scroll;
	overflow-y: hidden;
	display: flex;
	flex-direction: row;
	margin-top: 20rpx;
}
.top-list-item:last-child {
	margin-right: 40rpx;
}
.top-list-item {
	position: relative;
	width: 280rpx;
	height: 168rpx;
	margin-left: 40rpx;
}
.top-item-image {
	border-radius: 16rpx 16rpx 16rpx 16rpx;
	display: block;
	width: 280rpx;
	height: 100%;
}
.top-item-mark {
	border-radius: 16rpx 16rpx 16rpx 16rpx;
	position: absolute;
	left: 0;
	top: 0;
	width: 280rpx;
	height: 168rpx;
	color: rgba(255, 255, 255, 0.8);
	text-align: center;
	line-height: 168rpx;
	background-color: rgba(0, 0, 0, 0.4);
	font-size: 14rpx;
}
.list {
	margin-top: 20rpx;
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-gap: 40rpx;
	padding: 0 40rpx;
}
.item-text-content {
	padding: 16rpx 20rpx;
	background-color: white;
	border-radius: 0rpx 0rpx 12rpx 12rpx;
}
.item-title {
	font-size: 28rpx;
}
.item-image > image {
	border-radius: 12rpx 12rpx 0rpx 0rpx;
	width: 100%;
	display: block;
}
.item-range {
	font-size: 24rpx;
}
.item-price {
	color: #e54040;
}
.item-content {
	font-size: 20rpx;
	color: #666666;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}
</style>
